//
//  UIView+category.h
//  deerkids
//
//  Created by 王昭的Mac Air on 2017/8/28.
//  Copyright © 2017年 wangzhao. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (category)

-(CGFloat)x;
-(void)setX:(CGFloat)x;

-(CGFloat)y;
-(void)setY:(CGFloat)y;

-(CGFloat)height;
-(void)setHeight:(CGFloat)height;

-(CGFloat)width;
-(void)setWidth:(CGFloat)width;

- (CGFloat)centerX;
- (void)setCenterX:(CGFloat)centerX;

- (CGFloat)centerY;
- (void)setCenterY:(CGFloat)centerY;

//得到当前view所在的控制器
- (UIViewController *)getCurrentController;

/**
 添加单击手势
 */
- (void)addTapGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加长按手势
 */
- (void)addLongGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加拖拽手势
 */
- (void)addPanGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加左滑手势
 */
- (void)addLeftSwipeGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加右滑手势
 */
- (void)addRightSwipeGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加上滑手势
 */
- (void)addUpSwipeGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 添加下滑手势
 */
- (void)addDownSwipeGestureRecognizerWithTarget:(id)target action:(SEL)sel;

/**
 删除view上所有手势
 */
- (void)removeAllGestureRecognizer;


@end
